#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h> 
#include <stdlib.h> 
#include <string.h> 
#include <math.h> 
#include <ctype.h> 
#include <time.h> 
#include <assert.h>


int judge(int* i)
{
	if (*i > *(i - 1))
	{
		return 1;
	}
	if (*i < *(i - 1))
	{
		return -1;
	}
	else
		return 0;
}

int main()
{
	int n = 0;
	scanf("%d", &n);
	int arr[1000000] = { 0 };
	for (int i = 0; i < n; i++)
	{
		scanf("%d",&arr[i]);
	}

	int rise = 1;
	int fall = 1;
	int last_st = 2;
	for (int i = 1; i < n; i++)
	{
		if (judge(&arr[i]))
		{
			if (judge(&arr[i]) != last_st)
			{
				if (1 == judge(&arr[i]))
				{
					rise = fall + 1;
					last_st = 1;
				}
				else
				{
					fall = rise + 1;
					last_st = -1;
				}

			}
		}
		else
			continue;
	}

	printf("%d\n",(rise >= fall ? rise : fall));

	return 0;
}